<script src="/resource/web/js/jquery/form/jquery-validate.js"></script>
<link rel="stylesheet" href="/resource/web/js/jquery/vendor/bootstrap/css/bootstrap.min.css"/>
<script type="text/javascript">
    var $validator;
    var validatorRst;
    $(function () {
        $validator = $('form').validate({
            onKeyup: true,
            onSubmit: true,
            eachValidField: function () {

                $(this).closest('div').removeClass('error').addClass('success');
            },
            eachInvalidField: function () {

                $(this).closest('div').removeClass('success').addClass('error');
            },
            valid: function () {
                validatorRst = true;
            },
            invalid: function () {
                validatorRst = false;
            },
            conditional: {
                confirm: function () {

                    return $(this).val() == $('#password').val();
                }
            }
        });
    });

    var getValidateStatus = function(){
        return validatorRst;
    }
</script>